package net.melon.cata.inst.struts2;

import org.apache.struts2.ServletActionContext;

import net.esj.basic.plugins.struts2.action.AbstractDyncAction;

public class DyncJumpAction extends AbstractDyncAction {

	private static final String CATALOG_NAMESPACE = "/mp/catalog/";
	
	private String key;
	
	@Override
	protected void resolute() {
		String uri = ServletActionContext.getRequest().getRequestURI();
		///eg : uri = melon/plugin/catalog/region/list.htm
		//module = region; action = list;
		String module = uri.substring(uri.lastIndexOf("/catalog/"), uri.lastIndexOf("/"));
		String action = uri.substring(uri.lastIndexOf("/")+1,uri.lastIndexOf("."));
//		actionName = uri.substring(uri.lastIndexOf("/")+1,uri.lastIndexOf("."));
		actionName = module+"_"+action;
		namespace = CATALOG_NAMESPACE;
	}

	public String getKey() {
		return key;
	}

	public void setKey(String key) {
		this.key = key;
	}

}
